package com.starhub.application.agent.service;

import com.starhub.application.message.dto.Message;
import com.starhub.application.model.dto.ModelCallDTO;

import dev.langchain4j.model.output.Response;
import dev.langchain4j.service.Result;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;

import dev.langchain4j.data.message.AiMessage;
import dev.langchain4j.memory.ChatMemory;

public interface IModelService {

    String call(String mark, String message);

    AiMessage call(String mark, ChatMemory chatMemory, Long agentId, List availableFunctions, List<Message> historyMessages);

    Result<String> call(ModelCallDTO modelCallDTO);

    SseEmitter callSse(ModelCallDTO modelCallDTO);

    Response<AiMessage> callSse(ModelCallDTO modelCallDTO, PrintWriter ioWriter) throws IOException, ExecutionException, InterruptedException, TimeoutException;

    SseEmitter callSse(String mark, String message);
}
